<html>

<head>
<title>区块弹姬   by dancoin</title>

<script type="text/javascript">
 // alert(document.documentElement.clientHeight);
</script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=0.8, minimum-scale=0.7, maximum-scale=1.3, user-scalable=yes"/>
<script src="js/jquery.js"></script>
<style> 
.main
{
width:360px;
height:230px;
box-shadow: 10px 10px 5px #888888;
background-color:#c5d5cb;
padding:20px;
margin:auto;
border:2px solid;
border-radius:20px 20px 0px 0px;
-moz-border-radius:25px; /* Old Firefox */
position:relative;
}
.logo{
margin-top:-10px;
margin-left:-10px;
}
.info{
top:15px;
left:340px;
position:absolute;
}

.main1
{
margin:auto;
margin-top:20px;
width:360px;
height:360px;
box-shadow: 10px 10px 5px #888888;
background-color:#f5d5c0;
padding:20px;

border:2px solid;
border-radius:0px 0px 20px 20px;
-moz-border-radius:25px; /* Old Firefox */
}
.img{ 
float:right;
text-align:center
} 
.name{ 
width:220px;
float:left;} 

.name1{ 
margin:5px;
float:left;
width:70px;
text-align:center;
border:2px solid;
border-radius:20px;
-moz-border-radius:25px; /* Old Firefox */
}

 .name2{ 
margin:5px;
float:left;
width:120px;
text-align:center;
border:2px solid;
border-radius:20px;
-moz-border-radius:25px; /* Old Firefox */
}
 .shuxing{
margin-top:10px;
border:2px solid;
width:360px;
height:100px;
float:left;
}
 .help{
top:15px;
left:40px;
position:absolute;
width:345px;
height:645px;
opacity:0.8; background-color:#000;filter: alpha(opacity=80); 
color:#FFFFFF;
padding:20px;
}
</style> 
</head>

<body >
<div style="height:720px;width:450px;">
<div class="main">
<div class="logo"><img src="images/danji.png"></img></div>

<div class="info" id="show">[HELP]</div>

<div class="name">

<?php
error_reporting(0); 

//get函数
function curl_get_https($uri){
    $curl = curl_init(); // 启动一个CURL会话
    curl_setopt($curl, CURLOPT_URL, $uri);
    curl_setopt($curl, CURLOPT_HEADER, 0);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, true);  // 从证书中检查SSL加密算法是否存在
    $tmpInfo = curl_exec($curl);     //返回api的json对象
    //关闭URL请求
    curl_close($curl);
    return $tmpInfo;    //返回json对象
}

//姓名、外形、其他数据库
$ming="雪雨子钰涵楚晓紫小洁曼玥乐春素云琪茜娜青姝茹悦俊水娅菲昕锦凌君靖智芝宜凡鑫艳忻琰秀昱建露聪夏珂淼英晴圣益碧景荣漫会炜康禹姣德斐霞蕴路郗宸蕙澜俞怀汇咏慕培纯启烨承涛花丁礼汶萱岱乙昀韬霄乃惜光尚耀虹百周傲彧姗骁济纪抒镜从蓉瀚少牧善沫满渊淳诺墨佳涵嘉哲怡妍博宇晨";
$qizhi=array("天真","简单","腹黑","清新","活泼","贪婪","傲慢","娇憨","刁蛮","稳重","伶俐","小心","正义","勇敢","懒惰","幻想");
$waixing=array("女王","御姐","女神","女汉子","萝莉","魔女","乙女","眼镜娘","妖精","女超人","精灵","女装大佬","软妹","女巨人","巫女","女神经");
$face=array(24001,24005,24006,24012,24021,24663,24315,24052,24065,24066,24068,24080,24190,24593,24297,24894);
$hair=array(37930,34121,37145,44640,38350,34250,37030,44920,38701,34379,37560,44100,38440,34510,44050,38786);
$overall=array(1051059,1051081,1051137,1051241,1051432,1051420,1051344,1051295,1051349,1051016,1051107,1051114,1051122,1051115,1051185,1051176);
$onehand=array(1300000,1222015,1232005,1232026,1302044,1302146,1302155,1302157,1302220,1302221,1302265,1312075,1312122,1322149,1332128,1701000);
$chongwu=array("熊猫","萌猫","忠犬","懒猪","肥牛","山羊","山鸡","豚鼠","狗熊","老鹰","雅美蝶","兔子","草泥马","毛毛虫","鲤鱼王","凤凰");
//读取交易api
$s1=curl_get_https("http://dancoin.info/api/game.php?hashIn=".$_GET[add].",903ea360bdf231eb1e2d90a91e07b393a22d7ea0");
$hash =  json_decode(substr($s1,3),true);
//获得外形、初始属性
$ss=$hash['hash'][0][0];
$danji=array("name"=> mb_substr($ming,intval(hexdec(substr($ss,0,2))/2),1,"utf-8").mb_substr($ming,intval(hexdec(substr($ss,2,2))/2),1,"utf-8"),"qizhi"=> $qizhi[hexdec(substr($ss,4,1))].$waixing[hexdec(substr($ss,5,1))],"face"=> $face[hexdec(substr($ss,6,1))],"hair"=> $hair[hexdec(substr($ss,7,1))],"overall"=> $overall[hexdec(substr($ss,8,1))],"onehand"=> $onehand[hexdec(substr($ss,9,1))],"shoes"=> 1071025,"mei"=> hexdec(substr($ss,11,1)),"chongwu"=> $chongwu[hexdec(substr($ss,12,1))],"li"=> hexdec(substr($ss,20,1)),"min"=> hexdec(substr($ss,21,1)),"zhi"=> hexdec(substr($ss,22,1)),"zhuan"=> hexdec(substr($ss,23,1)),"hp"=> hexdec(substr($ss,24,1)),"mp"=> hexdec(substr($ss,25,1)));
//计算历练属性
for ($i = 1; $i < sizeof($hash['hash']); $i++) {  
   	if ($hash['hash'][$i][2]==1) {
		$danji["mei"] = hexdec(substr($hash['hash'][$i][0],11,1))-5+$danji["mei"];
		$danji["li"] = hexdec(substr($hash['hash'][$i][0],20,1))-5+$danji["li"];
		$danji["min"] = hexdec(substr($hash['hash'][$i][0],21,1))-5+$danji["min"];		
		$danji["zhi"] = hexdec(substr($hash['hash'][$i][0],22,1))-5+$danji["zhi"];		
		$danji["zhuan"] = hexdec(substr($hash['hash'][$i][0],23,1))-5+$danji["zhuan"];		
		$danji["hp"] = hexdec(substr($hash['hash'][$i][0],24,1))-5+$danji["hp"];		
		$danji["mp"] = hexdec(substr($hash['hash'][$i][0],25,1))-5+$danji["mp"];		
		$danji["wupin"] = hexdec(substr($hash['hash'][$i][0],26,3)).",".$danji["wupin"];
		$danji["shijian"] = hexdec(substr($hash['hash'][$i][0],36,2));
		$danji["shijianzhi"] = hexdec(substr($hash['hash'][$i][0],38,2));
		}
}  
//显示
echo "
<div class='name1'>姓名</div><div class='name2'>". $danji["name"] ."</div>
<div class='name1'>历练</div><div class='name2'>". $i ."次</div>
<div class='name1'>性格</div><div class='name2'>". $danji["qizhi"] ."</div>
<div class='name1'>外形</div><div class='name2'>". substr($ss,21,4) ."型</div>
<div class='name1'>宠物</div><div class='name2'>". $danji["chongwu"] ."</div>
<div class='name1'>魅力</div><div class='name2'>". $danji["mei"] ."</div>
</div> 
<div class='img'><img width=140 style='vertical-align:middle' src='https://labs.maplestory.io/api/GMS/latest/character/2000/". $danji["face"] .":default,". $danji["hair"] .",". $danji["overall"] .",". $danji["onehand"] .",". $danji["shoes"] ."/stand1/0?showears=false&showLefEars=false&resize=1&name=&flipX=false&bgColor=0,0,0,0'></img></div> 
</div>
<div class='main1'>
<div class='shuxing'>
<table border=1 width='100%' height='100%' style='text-align:center;'>
<tr><td width='25%' >HP</td><td width='25%'>". $danji["hp"] ."</td><td width='25%'>MP</td><td width='25%'>". $danji["mp"] ."</td></tr>
<tr><td>力量</td><td>". $danji["li"] ."</td><td>智力</td><td>". $danji["zhi"] ."</td></tr>
<tr><td>敏捷</td><td>". $danji["min"] ."</td><td>专注</td><td>". $danji["zhuan"] ."</td></tr>
</table>
</div>
<div class='shuxing'>
<table border=1 width='100%' height='100%' style='text-align:center;'>
<tr><td width='50%' >最新事件</td><td width='50%'>持有物品</td></tr>
<tr height='70%'><td width='50%' ><textarea name='a' style='width:170px;height:60px;border:0px;background:none;'></textarea></td><td width='50%'><textarea name='a' style='width:170px;height:60px;border:0px;background:none;'>".$danji["wupin"]."</textarea></td></tr>
";

?>
</table>
</div>
<div class="shuxing">
<table border=1 width="100%" height="100%" style="text-align:center;">
<tr height="50%"><td align="left">
<span id="source"></span>
</td></tr>
<tr height="50%"><td align="right">
<input type="text" id="workflowrank" placeholder="和我聊聊吧" style="height:30px;width:150px;font-size:18px;border:0px;background:none;">  <INPUT type="button"value="发送" id="b01" style="height:30px;width:50px;background-color:#636363;color:#FFFFFF;border: none;"/>
</td></tr>
</table>
</div>
</div>

<div id="help" class="help" > 

<h2>&nbsp;&nbsp;说明</h2>
<p>输入绑定钱包地址：<br>
<form action="http://dancoin.info/api/danji.php" method="get">
<input type="text" placeholder="钱包地址..." name="add" size="32"> <input type="submit" value="提交" >
</form>
</p>
<p>输入钱包地址，可登陆查看绑定“弹姬”</p>
<p><b>出生</b>：向地址 <b>903ea360bdf231eb1e2d90a91e07b393a22d7ea0</b> 转入 1 dancoin， 获得的第一个交易ID通过计算，得到一名弹姬，并获得唯一的外形与初始属性。<b>每个地址可并仅可绑定一名弹姬</b> </p>
<p><b>历练</b>：每向地址 <b>903ea360bdf231eb1e2d90a91e07b393a22d7ea0</b> 转入 1 dancoin， 得到的每个交易ID经过计算，为此次历练的成长值，并有机会获得物品、触发事件。</p>
<p><b>活动</b>：内测期间，花费全包，历练满100次，返 120 dancoin。</p>
<p>开源地址：https://gitee.com/Ske/danji</p>
<p align="center">手机打开<br><img width=120 src="http://qr.liantu.com/api.php?text=http://dancoin.info/danji.php?add=<?php echo $_GET[add]?>"/></p>
<p align="center"><button id="hide" type="button" style="background-color:#FFFFFF;border: none;">我知道了，隐藏帮助</button></p>
</div> 

</div>


	 
<script type="text/javascript">


//隐藏显示帮助界面  
$(document).ready(function(){
  
  if(getQueryString("add").length == 40)  $("#help").hide();
  
  $("#hide").click(function(){
  $("#help").hide();
  });
  $("#show").click(function(){
  $("#help").show();
  });
//获得get值
function getQueryString(name) {  
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");  
    var r = window.location.search.substr(1).match(reg);  
    if (r != null) return decodeURI(r[2]);  
    return null;  
}  
//聊天程序
  $("#b01").click(function(){
  htmlobj=$.ajax({url:"http://dancoin.info/chat.php?key="+$("#workflowrank").val(),async:false});
  var ss=htmlobj.responseText;
  $("#source").html("涵子："+ss.replace(/菲菲/g,"涵子"));
  });
});


</script>

</body>

</html>